<!-- Dom模板 -->
<template>
    
  <div class="edit">
        <!-- Dom内容 -->
    <el-form ref="form" :model="data" label-width="80px">
      <el-form-item label="活动编号">
        <el-input v-model="data.id" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="活动标题">
        <el-input v-model="data.title" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="使用范围">
        <el-input v-model="data.useRange" :disabled="true"></el-input>
      </el-form-item>
      <el-form-item label="面值">
        <el-input v-model="data.faceValue"></el-input>
      </el-form-item>
      <el-form-item label="有效期">
        <el-date-picker
          v-model="data.expiryDate"
          type="date"
          placeholder="选择日期"
        >
        </el-date-picker>
      </el-form-item>
      <el-form-item label="状态">
        <el-select v-model="data.pouponType" placeholder="请选择">
          <el-option label="待支付" value="0"></el-option>
          <el-option label="已支付" value="1"></el-option>
          <el-option label="已关闭" value="2"></el-option>
          <el-option label="已退款" value="3"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <div class="btn">
      <el-row>
        <el-button
          type="primary"
          style="background: #38a28a"
          @click="changeData"
          >确定</el-button
        >
      </el-row>
      <el-row>
        <el-button
          type="primary"
          style="background: #eaeaea; color: black"
          @click="closePop"
          >取消</el-button
        >
      </el-row>
    </div>
  </div>
</template>

<script>
// import a from './a'; // 引入组件
export default {
  name: "",
  data() {
    return {
      msg: "测试",
      data: "",
    };
  },
  props: ["editData", "closePop", "getEditData"], // 生命周期 - 创建完成（访问当前this实例）
  created() {
    this.data = JSON.parse(JSON.stringify(this.editData));
    console.log(this.data);
  }, // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {},
  // Vue方法定义
  methods: {
    changeData() {
        this.getEditData(this.data);
        this.closePop();
    },
  },
};
</script>

<style scoped>
/* @import url(''); 引入css类 */
.edit {
  z-index: 99;
  width: 400px;
  height: 500px;
  box-sizing: border-box;
  background: #eaeaea;
  border-radius: 10px;
  padding: 10px;
  position: fixed;
  left: 50%;
  margin-left: -200px;
  top: 50%;
  margin-top: -250px;
  border: 1px solid #ccc;
}
</style>